#!/bin/bash

image_name="registry.cn-shanghai.aliyuncs.com/zhph-server/llamafactory:0.9.4"
device="llamafactory"

# Create output directory
output_dir="docker-images-tar-llamafactory"
mkdir -p "$output_dir"

# File to store image list
image_list_file="$output_dir/image-list.txt"
> "$image_list_file"

# Loop through each service, pull and save the Docker image
    full_image="$image_name"
    echo "Pulling $full_image ..."
    docker pull "$full_image"
    tar_file="$output_dir/llamafactory.tar"
    echo "Saving $full_image to $tar_file ..."
    docker save -o "$tar_file" "$full_image"
    echo "$tar_file" >> "$image_list_file"
done
